import request from '@/utils/request'

// -------------------------------事项管理------------------------------------
// 获取事项
export function getMatterDataList(item_name) {
  return request({
    url: `api/Appointment_information/getAppointment`,
    method: 'get',
    item_name: item_name
  })
}

// 事项唯一标识校验
export function getIdentificationCode() {
  return request({
    url: `api/Event_managementCtl/event_ldentificationCode`,
    method: 'get'
  })
}

// 查询列表
export function getDispatchList(data) {
  return request({
    url: `api/Dispatch_management/getManagement`,
    method: 'get',
    params: data
  })
}
// 机构列表
export function getStructureList(type) {
  return request({
    url: `api/Dispatch_management/getdepartment_information`,
    method: 'get',
    params:{
      type:type
    }
  })
}
// 获取乡镇
export function getTownshipList() {
  return request({
    url: `api/Event_managementCtl/gettownship`,
    method: "get",
  });
}
//
export function getTownnameList() {
  return request({
    url: `api/Event_managementCtl/gettownship_list`,
    method: "get",
  });
}
// 更换人员
export function changeUnitPeople(data) {
  return request({
    url: `api/Dispatch_management/getDistribution_update`,
    method: 'get',
    params: data
  })
}
// 录入
export function addAppointment(data) {
  return request({
    url: `api/Appointment_information/addAppointment`,
    method: 'POST',
    data
  })
}
// 查看详情
export function getbaseInfoList(app_id) {
  return request({
    url: `api/Dispatch_management/getdetails`,
    method: 'get',
    params: {
      app_id: app_id
    }
  })
}
// 审核
export function examineInfoList(data) {
  return request({
    url: `api/Dispatch_management/getAudit_information`,
    method: 'get',
    params: data
  })
}
// 派发人员
export function handleInfoList(data) {
  return request({
    url: `api/Dispatch_management/getDistribution`,
    method: 'get',
    params: data
  })
}
// ---------------设备管理--------------------------------------------
// 删除
export function delDevice(id) {
  return request({
    url: `api/Device_managementCtl/delDevice`,
    method: 'get',
    params: {
      id: id
    }

  })
}
// 录入
export function getDevice(data) {
  return request({
    url: `api/Device_managementCtl/getDevice`,
    method: 'POST',
    data
  })
}
// 获取列表
export function getManagementList(data) {
  return request({
    url: `api/Device_managementCtl/getDevice_management`,
    method: 'get',
    params: data
  })
}
// 绑定与解除绑定  启用与停用
export function bindingInfo(data) {
  return request({
    url: `api/Device_managementCtl/getupdat_status`,
    method: 'get',
    params: data
  })
}
// 查询绑定人员名单
export function getBindingName(data) {
  return request({
    url: `api/Device_managementCtl/getUser`,
    method: 'get',
    params: data
  })
}
// 获取归属单位
export function getCompanyList() {
  return request({
    url: `api/Device_managementCtl/getCompany`,
    method: 'get'
  })
}
// -----------------------------位置--------------

// 获取列表
export function getPositionList(data) {
  return request({
    url: `api/Device_managementCtl/getDevice_information`,
    method: 'get',
    params: data
  })
}
// -----------------------------事项管理---------------
// 获取列表
export function getMatterList(data) {
  return request({
    url: `api/Event_managementCtl/getDevice_management`,
    method: 'get',
    params: data
  })
}
// 新增
export function saveMatterList(data) {
  return request({
    url: `api/Event_managementCtl/addEvent_management`,
    method: 'POST',
    data
  })
}
// 编辑
export function saveEditMatterList(data) {
  return request({
    url: `api/Event_managementCtl/updateEvent_management`,
    method: 'POST',
    data
  })
}
// 删除
export function deleteRowList(id) {
  return request({
    url: `api/Event_managementCtl/delEvent_management`,
    method: 'get',
    params: {
      id: id
    }

  })
}

//
export function getIssueListDetail(id) {
  return request({
    url: `api/Event_managementCtl/getdetil`,
    method: 'get',
    params: {
      id: id
    }

  })
}

// 统计分析

export function getStatistics(type) {
  return request({
    url: `api/Event_managementCtl/statistics`,
    method: 'get',
    params: {
      type
    }
  })
}
